@main
def Test =
  val kenobi = 0b1

  assert(kenobi == 1)

  assert(0B0000 == 0)
  assert(0B0001 == 1)
  assert(0B0010 == 2)
  assert(0B0100 == 4)
  assert(0B1000 == 8)

  assert(0b0000 == 0)
  assert(0b0001 == 1)
  assert(0b0010 == 2)
  assert(0b0100 == 4)
  assert(0b1000 == 8)

  assert(0b0001_0000 == 16)
  assert(0b0010_0000 == 32)
  assert(0b0100_0000 == 64)
  assert(0b1000_0000 == 128)

  assert(0b0001_0000_0000 == 256)
  assert(0b0010_0000_0000 == 512)
  assert(0b0100_0000_0000 == 1024)
  assert(0b1000_0000_0000 == 2048)

  assert(0b0001_0000_0000_0000 == 4096)
  assert(0b0010_0000_0000_0000 == 8192)
  assert(0b0100_0000_0000_0000 == 16384)
  assert(0b1000_0000_0000_0000 == 32768)

  assert(0b0001__0000_0000_0000_0000 == 65536)
  assert(0b0010__0000_0000_0000_0000 == 131072)
  assert(0b0100__0000_0000_0000_0000 == 262144)
  assert(0b1000__0000_0000_0000_0000 == 524288)

  assert(0b0001_0000__0000_0000_0000_0000 == 1048576)
  assert(0b0010_0000__0000_0000_0000_0000 == 2097152)
  assert(0b0100_0000__0000_0000_0000_0000 == 4194304)
  assert(0b1000_0000__0000_0000_0000_0000 == 8388608)

  assert(0b0001_0000_0000__0000_0000_0000_0000 == 16777216)
  assert(0b0010_0000_0000__0000_0000_0000_0000 == 33554432)
  assert(0b0100_0000_0000__0000_0000_0000_0000 == 67108864)
  assert(0b1000_0000_0000__0000_0000_0000_0000 == 134217728)

  assert(0b0001_0000_0000_0000__0000_0000_0000_0000 == 268435456)
  assert(0b0010_0000_0000_0000__0000_0000_0000_0000 == 536870912)
  assert(0b0100_0000_0000_0000__0000_0000_0000_0000 == 1073741824)
  assert(0b1000_0000_0000_0000__0000_0000_0000_0000L == 2147483648L)

  assert(0b1000_0000_0000_0000__0000_0000_0000_0000 == -2147483648) // Signed !
  assert(0b1111_1111_1111_1111__1111_1111_1111_1111 == -1)

  // Randomly generated using https://numbergenerator.org/random-32-bit-binary-number#!numbers=10&length=32&addfilters=
  // Converted to signed decimal using https://onlinetoolz.net/unsigned-signed#base=2&bits=32
  assert(0b0110_1000_1100_0101_0010_1100_0100_0011 ==  1757752387)
  assert(0b1111_0101_0100_1011_0101_1000_0011_0110 == -179611594)
  assert(0b0000_0011_0000_1010_1010_0011_0000_0000 ==  51028736)
  assert(0b0101_0010_1111_1001_0100_0101_1101_1011 ==  1392068059)
  assert(0b1001_0000_1111_1001_1011_1101_1100_1111 == -1862681137)

  assert(0B0000_0111_1110_1100_0111_1100_1000_0010 ==  132938882)
  assert(0B0000_1011_0111_1011_0001_1010_1010_1000 ==  192617128)
  assert(0B1100_1100_1000_1010_1111_0111_0100_1101 == -863307955)
  assert(0B1000_0000_0001_0010_0001_1001_0101_1110 == -2146297506)
  assert(0B1110_0000_0110_1100_0111_0110_1100_1111 == -529762609)

  assert(0b0010_1001_0101_1001__1010_0100_1000_1010__1001_1000_0011_0111__1100_1011_0111_0101L ==  2979593543648529269L)
  assert(0b1101_1110_0100_1000__0010_1101_1010_0010__0111_1000_1111_1001__1010_1001_0101_1000L == -2429641823128802984L)
